<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*,java.io.*,java.sql.*,InvestmentPojo.*,ImmovableIndia.*;"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<title>FDI Tool</title>
<link rel="icon" type="image664/png" href="images664/dev7logo.png" />

</head>
<%!
ConnectionPool pool=null;
public Connection getConnection() throws SQLException, Exception {
	pool=new ConnectionPool();
	return pool.getConnection();
}
%>
<% 
List optionsList123=new ArrayList();
Connection con=null;
Statement st=null;
ResultSet rs=null;
String optionvalue="";
try{
	con=getConnection();
	st=con.createStatement();
	rs=st.executeQuery("select * from investment_in_india where form_id = 1 order by option_label");
	
	while(rs.next()){
		OptionsList obj = new OptionsList();
		obj.setOptionId(rs.getString(1));
		obj.setListTypeId(rs.getString(2));
		obj.setOptionLabel(rs.getString(3));
		obj.setOptionValue(rs.getString(4));
		obj.setQestFlag(rs.getString(7));
		obj.setShowFlag(rs.getString(8));
		optionsList123.add(obj);
	}
}catch(Exception e ){
	e.printStackTrace();
}finally{
	try {
		if(null != rs)
			pool.releaseResources(rs);
		System.out.println("Connection RS closed........--------------");
		if(null != st)
			pool.releaseResources(st);
		System.out.println("Connection ST closed........--------------");
		if(null != con)
		pool.releaseConnection(con);
		System.out.println("Connection con closed........--------------");
	} catch (Exception e) {
		e.printStackTrace();
	}
}
%>

<script language='javascript' type='text/javascript'>
function loadSectorDropDown()
{
	var selectedValue ='';
	var selectedInvestor ='';
	var radios ='';
	document.getElementById("TR0444").innerHTML = "<table><tr><td align='center'>Please wait while loading...</td></tr></table>";
	radios = document.getElementsByName("entity");		
	for(var i = 0; i < radios.length; i++) {
	    if(radios[i].checked) selectedValue = radios[i].value;  
	} 	
	radios = document.getElementsByName("investor");
	for(var i = 0; i < radios.length; i++) {
	    if(radios[i].checked) selectedInvestor = radios[i].value;  
	}
	//alert("selected value..."+selectedValue);
	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.open("POST","dropDownAction.do?key="+selectedValue+"&invkey="+selectedInvestor+"&formId=1",true);
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     {
		  if("" == xmlhttp.responseText){
			  document.getElementById("TR0444").innerHTML = "No Data Found";
		  }else{
	      document.getElementById("TR0444").innerHTML= xmlhttp.responseText;
		  }
 	    }
	  }
	xmlhttp.send();
	//selectedValue = '';
}
function loadFormToSubmit()
{

	var selectedValue ='';
	var sectorId = '';
	var subsectorId = '';
	var invRadiosValue = getSelectedRadiosValue("investor");
	    if(invRadiosValue != "" && null != invRadiosValue){ 
	    	selectedValue = invRadiosValue;  
	}	//alert(selectedValue+"--1");
	var entityRadios = getSelectedRadiosValue("entity");		
	    if(entityRadios != "" && null != entityRadios){ 
	    	selectedValue = selectedValue+'.'+entityRadios;  
	} 	///alert(selectedValue+"--2");
	sectorId = document.getElementById("sectorid");
		if(sectorId.value != "")		
		selectedValue = selectedValue+'.'+sectorId.value; 
	//alert(selectedValue+"--3");
    subsectorId= document.getElementById("subsectorid");
    	if(subsectorId.value != ""){
    	selectedValue = selectedValue+'.'+subsectorId.value;
    }//alert(selectedValue+"--4");
    var repatValue = getSelectedRadiosValue("repat");
		if(repatValue != "" && null != repatValue){
		selectedValue = selectedValue+'.'+repatValue;
	}
	var modeOfInvValue = getSelectedRadiosValue("modeofinvest");
	 	if(modeOfInvValue !="" && null != modeOfInvValue){
		selectedValue = selectedValue+'.'+modeOfInvValue;
	 }  //alert(selectedValue+"--5");
	var msmedValue = getSelectedRadiosValue("msmed");
		if(msmedValue != "" && null != msmedValue){
			selectedValue = selectedValue+'.'+msmedValue;
		}
	var notMsmedValue = getSelectedRadiosValue("notmsmed");
		if(notMsmedValue != "" && null != notMsmedValue){
			selectedValue = selectedValue+'.'+notMsmedValue;
		}
	//alert("selected value = "+selectedValue);
	//document.getElementById("selected").innerHTML = "Selected Key - "+selectedValue;
	var xmlhttp;
	if (window.XMLHttpRequest)
	  {
		// code for IE7+, Firefox, Chrome, Opera, Safari
	   xmlhttp=new XMLHttpRequest();
	  }
	else
	  {
		// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.open("POST","investorAction.do?key="+selectedValue+"&formId=1",true);
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	     {
		document.getElementById("myDiv").innerHTML='';
		cache: false;
	    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
	    cache: false;
	    }
	  }
	xmlhttp.send();
	//selectedValue = '';
}
function radioUncheckFun(radiosname){
	var radList = document.getElementsByName(radiosname);
	if(null != radList){
	 for (var i = 0; i < radList.length; i++) {
	 if(radList[i].checked) radList[i].checked = false;
	 }
}}
function getSelectedRadiosValue(NameofRadios){
	var selectedRadioValue='';
	var radList = document.getElementsByName(NameofRadios);
	if(null != radList){
	 for (var i = 0; i < radList.length; i++) {
	 if(radList[i].checked) selectedRadioValue = radList[i].value;
	 }
	 return selectedRadioValue;
   }
}
function goForConclution(){
	document.getElementById("Answers").style.display="";
	//document.getElementById("selected").style.display="";
	document.getElementById("myDiv").innerHTML="<img alt='Plz wait...' src='loading9.gif' width='30'/>&nbsp;&nbsp;<p valign='top'>Plz wait...while loading...</p>";
	document.getElementById('bottom').scrollIntoView();
	loadFormToSubmit();
	if("10" == getSelectedRadiosValue("entity")){
		goForGuidelines();
		document.getElementById("GGLines").style.display='';
	 }else document.getElementById("GGLines").style.display='none';
	
}
function onClickMSMED(){
	 radioUncheckFun("notmsmed");
	 //document.getElementById("selected").style.display="none";
	 var yesbutton = document.getElementById("tr8yes");
	 var nobutton = document.getElementById("tr8no");
	 if(yesbutton.checked){
		 //document.getElementById("table6").style.display="";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("table7").style.display="none";
		}
	
	 if(nobutton.checked){
		 document.getElementById("submitbutton").style.display="none";
		 document.getElementById("table6").style.display="none";
		 document.getElementById("table7").style.display="";
		 document.getElementById("Answers").style.display="none";
	 }
	 
}
function onClickNotMSMED(){
	//document.getElementById("selected").style.display="none";
	 var yesbutton=document.getElementById("yesnmsmed");
	 var nobutton=document.getElementById("nonmsmed");
	 if(yesbutton.checked){
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		}
	 if(nobutton.checked){
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("submitbutton").style.display="";
	 }
}
function onChangeInvestor(id){
	//document.getElementById("selected").style.display="none";
	var id1= document.getElementById(id);
	radioUncheckFun("modeofinvest");
	radioUncheckFun("repat");
	 var arr=new Array();
     arr=id.split("~");     
     if(arr[1] == "N"){
        // alert("buf...");
    	 document.getElementById("submitbutton").style.display="";
     }
		switch (id1.value)
	{    
	case '1':
		 setVisibilityArr([document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("litag6"),document.getElementById("table1"),document.getElementById("table2"),document.getElementById("table3"),document.getElementById("table4"),document.getElementById("table6")],"none");
		 document.getElementById("quest").style.display=""; document.getElementById("sectorid").selectedIndex='';
		 radioUncheckFun("entity"); radioUncheckFun("msmed"); radioUncheckFun("notmsmed"); radioUncheckFun("repat"); radioUncheckFun("modeofinvest");
		 break;
	case '2':
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("litag6"),document.getElementById("table2"),document.getElementById("Answers")],"none");
		 setVisibilityArr([document.getElementById("table1"),document.getElementById("quest")],""); document.getElementById("sectorid").selectedIndex='';
		 break;
	case '3':
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag4"),document.getElementById("litag6"),document.getElementById("Answers")],"none");
		 setVisibilityArr([document.getElementById("quest"),document.getElementById("table1")],""); document.getElementById("sectorid").selectedIndex='';
		 break;
	case '4':
		 setVisibilityArr([document.getElementById("table1"),document.getElementById("quest")],""); document.getElementById("sectorid").selectedIndex='';
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag6"),document.getElementById("Answers")],"none");
		 break;
	case '6':
		 setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("Answers")],"none");
		 setVisibilityArr([document.getElementById("table1"),document.getElementById("quest")],""); document.getElementById("sectorid").selectedIndex='';
		 break;
	default:
		setVisibilityArr([document.getElementById("litag1"),document.getElementById("litag2"),document.getElementById("litag3"),document.getElementById("litag4"),document.getElementById("litag6")],"");
	    setVisibilityArr([document.getElementById("quest"),document.getElementById("table1"),document.getElementById("table2"),document.getElementById("table3"),document.getElementById("table4"),document.getElementById("table5"),document.getElementById("table6"),document.getElementById("table7"),document.getElementById("table8"),document.getElementById("Answers"),document.getElementById("submitbutton")],"none");
		radioUncheckFun("investor"); radioUncheckFun("entity"); onChangeEntity('quest1'); radioUncheckFun("repat");
		document.getElementById("sectorid").selectedIndex=''; document.getElementById("subsectorid").selectedIndex='';
	}	
}
function onChangeEntity(id){
	//document.getElementById("selected").style.display="none";
	var id1= document.getElementById(id);
		switch (id1.value)
	{    
	case '8':
		 document.getElementById("entity9").style.display="none";
		 document.getElementById("entity10").style.display="none";
		 document.getElementById("entity11").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';	
		 loadSectorDropDown();
		 break;
	case '9':
		 //alert(id1.value+"++++++++");1
         document.getElementById("entity8").style.display="none";
		 document.getElementById("entity10").style.display="none";
		 document.getElementById("entity11").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';
		 loadSectorDropDown();
		 break;
	case '10':
		// alert(id1.value+"++++++++");
         document.getElementById("entity8").style.display="none";
		 document.getElementById("entity9").style.display="none";
		 document.getElementById("entity11").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';
		 loadSectorDropDown();
		 break;
	case '11':
		 //alert(id1.value+"++++++++");
         document.getElementById("entity8").style.display="none";
		 document.getElementById("entity9").style.display="none";
		 document.getElementById("entity10").style.display="none";
		 //document.getElementById("entity12").style.display="none";
		 //document.getElementById("entity13").style.display="none";
		 document.getElementById("table2").style.display="";
		 document.getElementById("quest1").style.display="";
		 document.getElementById("sectorid").selectedIndex='';
		 loadSectorDropDown();
		 break;
	default:
		//alert('samba');
        document.getElementById("entity8").style.display="";
        document.getElementById("entity9").style.display="";
		document.getElementById("entity10").style.display="";
		document.getElementById("entity11").style.display="";
		//document.getElementById("entity12").style.display="";
		//document.getElementById("entity13").style.display="";
		document.getElementById("table2").style.display="none";
        document.getElementById("table3").style.display="none";
        document.getElementById("table4").style.display="none";
        document.getElementById("table5").style.display="none";
        document.getElementById("table6").style.display="none";
        document.getElementById("table7").style.display="none";
        document.getElementById("table8").style.display="none";
		document.getElementById("quest1").style.display="none";
		document.getElementById("Answers").style.display="none";
		document.getElementById("submitbutton").style.display="none";
		document.getElementById("sectorid").selectedIndex='';
		radioUncheckFun("entity");	
	}	
		if("10" == getSelectedRadiosValue("entity")){
			 document.getElementById("sectorialcaps").style.display="";
		 }else document.getElementById("sectorialcaps").style.display="none";
}

function onInvModeChange(id){
	//document.getElementById("selected").style.display="none";
	document.getElementById("Answers").style.display="none";
	var id1= document.getElementById(id);	
    	 document.getElementById("submitbutton").style.display="none";
    	 document.getElementById("table5").style.display="none";
    	 
     switch (id1.value)
	{   
	case '78':
		 //alert(id1.value+"++++++++");
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '79':
		 //alert(id1.value+"++++++++");1
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '80':
		// alert(id1.value+"++++++++");
         document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 
		 break;
	case '81':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '82':
		 //alert(id.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '83':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '84':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '85':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '86':
		 //alert(id1.value+"++++++++");
         document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '104':
		 //alert(id1.value+"++++++++");
      	 document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '105':
		 //alert(id1.value+"++++++++");
       	 document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '106':
		 //alert(id1.value+"++++++++");
      	 document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode107").style.display="none";
		 document.getElementById("submitbutton").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	case '107':
		 //alert(id1.value+"++++++++");
      	 document.getElementById("invmode78").style.display="none";
		 document.getElementById("invmode79").style.display="none";
		 document.getElementById("invmode80").style.display="none";
		 document.getElementById("invmode81").style.display="none";
		 document.getElementById("invmode82").style.display="none";
		 document.getElementById("invmode83").style.display="none";
		 document.getElementById("invmode84").style.display="none";
		 document.getElementById("invmode85").style.display="none";
		 document.getElementById("invmode104").style.display="none";
		 document.getElementById("invmode105").style.display="none";
		 document.getElementById("invmode106").style.display="none";
		 document.getElementById("table5").style.display="";
		 document.getElementById("quest2").style.display="";
		 break;
	default:
		//alert('samba');
		 document.getElementById("invmode81").style.display="";
		 document.getElementById("invmode82").style.display="";
		 document.getElementById("invmode83").style.display="";
		 document.getElementById("invmode84").style.display="";
		 document.getElementById("invmode85").style.display="";
		 document.getElementById("invmode78").style.display="";
		 document.getElementById("invmode79").style.display="";
		 document.getElementById("invmode80").style.display="";
		 document.getElementById("invmode104").style.display="";
		 document.getElementById("invmode105").style.display="";
		 document.getElementById("invmode106").style.display="";
		 document.getElementById("invmode107").style.display="";
         document.getElementById("table5").style.display="none";
         document.getElementById("table6").style.display="none";
         document.getElementById("table7").style.display="none";
		 document.getElementById("quest2").style.display="none";
		 document.getElementById("submitbutton").style.display="none";
		 radioUncheckFun("modeofinvest");	
		 radioUncheckFun("msmed");
		 radioUncheckFun("notmsmed");
     }
		//alert(id1.value+"--answer");
}

function onSectorChange(){
	//document.getElementById("selected").style.display="none";
	var x=document.getElementById("sectorid").selectedIndex;
	var sectoroptionvalue=document.getElementById("sectorid").options;
	var subsectorid = document.getElementById("subsectorid");
	radioUncheckFun("modeofinvest");
	radioUncheckFun("repat"); onInvModeChange('quest2');
	 document.getElementById("table5").style.display="none";
	 document.getElementById("table7").style.display="none";
	 document.getElementById("Answers").style.display="none";
	//subsectorid.innerHTML = xmlhttp.responseText;
	if(sectoroptionvalue != null && "" != sectoroptionvalue){
		switch(sectoroptionvalue[x].value){
		case '17':
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML +="<option value=''>Select One</option>";
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("13")){
				%>
				subsectorid.innerHTML +="<option name='<%=obj.getOptionId()%>' id='<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>' value='<%=obj.getOptionValue()%>' title='<%=obj.getOptionValue()%>'><%=obj.getOptionLabel()%></option>";
				<%	
				}
				}	  		
			} %>
			    break;
		case '18':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("14")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '19':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("15")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '25':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("16")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '28':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("17")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '30':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("18")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '31':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("19")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '34':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("26")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '38':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("20")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '45':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("22")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		case '47':
			//alert(sectoroptionvalue[x].text+"-------function inside start......");
			subsectorid.innerHTML='';
			document.getElementById("table3").style.display="";
			document.getElementById("table4").style.display="none";
			document.getElementById("table8").style.display="none";
			document.getElementById("Answers").style.display="none";
			document.getElementById("submitbutton").style.display="none";
			subsectorid.innerHTML="<option value=''>Select One</option>"
				//alert("function inside start......");
			<% if(optionsList123 != null){
				for(int i=0;i<optionsList123.size();i++){
				OptionsList obj =(OptionsList)optionsList123.get(i); 
				if(obj.getListTypeId() != null && obj.getListTypeId().equals("21")){
				%>
				subsectorid.innerHTML +='<option name="<%=obj.getOptionId()%>" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>"><%=obj.getOptionLabel()%></option>'
				<%	
				}
				}	  		
			} %>
			    break;
		default :
		        var radios=0;
		        var selectedValue=0;
		        radioUncheckFun("modeofinvest");
		        radioUncheckFun("msmed"); 
		   	 radioUncheckFun("notmsmed"); radioUncheckFun("repat");
		        selectedValue = getSelectedRadiosValue("entity");		
				document.getElementById("subsectorid").selectedIndex='';
				document.getElementById("table3").style.display="none";
				document.getElementById("submitbutton").style.display="none";
				document.getElementById("Answers").style.display="none";
				if("3" == getSelectedRadiosValue("investor")){//FIPB Approval
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}
					 /* document.getElementById("table4").style.display="none";
			    	 document.getElementById("submitbutton").style.display=""; */
				}else if("4" == getSelectedRadiosValue("investor")){//NRI FDI plicy
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						var nriAutomaticArr = new Array("15","20","22","24","41","42","43","44","110");
						var nriProhibitedArr = new Array("14","16","21","23","26","27","29","33","34","37","46");
						var nriGovernmentArr = new Array("97","32","35","40","39");
						var autoAndGovArr=new Array("52","36");
						var automaticsector = document.getElementById("sectorid");
						document.getElementById("table8").style.display="none";
						document.getElementById("table4").style.display="none";
						if(automaticsector != null && automaticsector != ""){
						for (var i = 0; i < nriAutomaticArr.length; i++){
							if(nriAutomaticArr[i] == automaticsector.value){
							 document.getElementById("table8").style.display="";								
							}
							  } 
						for (var i = 0; i < nriProhibitedArr.length; i++){
							if(nriProhibitedArr[i] == automaticsector.value){
								document.getElementById("submitbutton").style.display="";								
							}
							  } 
						for (var i = 0; i < nriGovernmentArr.length; i++){
							if(nriGovernmentArr[i] == automaticsector.value){
								document.getElementById("table8").style.display=""
								//document.getElementById("submitbutton").style.display="";								
							}
							  } 
						for (var i = 0; i < autoAndGovArr.length; i++){
							if(autoAndGovArr[i] == automaticsector.value){
								document.getElementById("table8").style.display=""
								//document.getElementById("submitbutton").style.display="";								
							}
						  } 
						}
					}
				}else if("2" == getSelectedRadiosValue("investor")){//3rd option FDI plicy
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						if("8" == getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("submitbutton").style.display="";
						}else if("10" != getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("table8").style.display="";
						}else if("10" == getSelectedRadiosValue("entity")){
							var othAutomaticArr = new Array("15","20","22","24","36","41","42","43","44","110");
							var othProhibitedArr = new Array("14","16","21","23","26","27","29","33","34","37");
							var othGovernmentArr = new Array("97","32","35","40","39","46","57");
							var autoAndGovArr = new Array("52","49","53","36","73");
							var automaticsector = document.getElementById("sectorid");
							document.getElementById("table8").style.display="none";
							document.getElementById("table4").style.display="none";
							if(automaticsector != null && automaticsector != ""){
							for (var i = 0; i < othAutomaticArr.length; i++){
								if(othAutomaticArr[i] == automaticsector.value){
								 document.getElementById("table4").style.display="";								
								}
								  } 
							for (var i = 0; i < othProhibitedArr.length; i++){
								if(othProhibitedArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < othGovernmentArr.length; i++){
								if(othGovernmentArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < autoAndGovArr.length; i++){
								if(autoAndGovArr[i] == automaticsector.value){
									document.getElementById("table4").style.display="";								
								}
								  }
							}
						}
					}
				}else if("6" == getSelectedRadiosValue("investor")){//OCB's
					if("8" == getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("submitbutton").style.display="";
					}else if("10" != getSelectedRadiosValue("entity")){
						document.getElementById("table4").style.display="none";
						document.getElementById("table8").style.display="";
					}else if("10" == getSelectedRadiosValue("entity")){
						if("8" == getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("submitbutton").style.display="";
						}else if("10" != getSelectedRadiosValue("entity")){
							document.getElementById("table4").style.display="none";
							document.getElementById("table8").style.display="";
						}else if("10" == getSelectedRadiosValue("entity")){
							var othAutomaticArr = new Array("15","20","22","24","41","42","43","44","110");
							var othProhibitedArr = new Array("14","16","21","23","26","27","29","33","34","37","46");
							var othGovernmentArr = new Array("97","32","35","40","39","46","57");
							var autoAndGovArr = new Array("52","49","53","36","73");
							var automaticsector = document.getElementById("sectorid");
							document.getElementById("table8").style.display="none";
							document.getElementById("table4").style.display="none";
							if(automaticsector != null && automaticsector != ""){
							for (var i = 0; i < othAutomaticArr.length; i++){
								if(othAutomaticArr[i] == automaticsector.value){
								 document.getElementById("table4").style.display="";								
								}
								  } 
							for (var i = 0; i < othProhibitedArr.length; i++){
								if(othProhibitedArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < othGovernmentArr.length; i++){
								if(othGovernmentArr[i] == automaticsector.value){
									document.getElementById("submitbutton").style.display="";								
								}
								  } 
							for (var i = 0; i < autoAndGovArr.length; i++){
								if(autoAndGovArr[i] == automaticsector.value){
									document.getElementById("table4").style.display="";								
								}
								  } 
							}
						}
					}
				}
				else{
			    	 document.getElementById("table4").style.display="";
			     }
			     //onInvModeChange('quest2');
		}
	}
	}
 function onSubSectorChange(){
	 //document.getElementById("selected").style.display="none";
	 radioUncheckFun("modeofinvest");
	 radioUncheckFun("msmed");
	 radioUncheckFun("notmsmed"); radioUncheckFun("repat");
	 onInvModeChange('quest2');  document.getElementById("submitbutton").style.display="none";
	 document.getElementById("Answers").style.display="none";
	 if("3" == getSelectedRadiosValue("investor")){//FIPB Approval 
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}
			 /* document.getElementById("table4").style.display="none";
	    	 document.getElementById("submitbutton").style.display=""; */
	}else if("4" == getSelectedRadiosValue("investor")){//NRI FDI plicy
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				var nriAutomaticArr = new Array("48","49","50","51","53","54","55","60","61","63","64","69","70","75","80","73","76","111");
				var nriGovernmentArr = new Array("57","58","59","62","65","66","67","68","71","74","77","109");
				var automaticsector = document.getElementById("subsectorid");
				var autoAndGovArr=new Array("52","56","72","108");
				document.getElementById("table8").style.display="none";
				document.getElementById("table4").style.display="none";
				if(automaticsector != null && automaticsector != ""){
				for (var i = 0; i < nriAutomaticArr.length; i++){
					if(nriAutomaticArr[i] == automaticsector.value){
					 document.getElementById("submitbutton").style.display="none";
					 document.getElementById("table8").style.display="";								
					}
					  } 
				for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector.value){
						document.getElementById("table8").style.display=""
						//document.getElementById("submitbutton").style.display="";								
					}
					  } 
				for (var i = 0; i < autoAndGovArr.length; i++){
					if(autoAndGovArr[i] == automaticsector.value){
						document.getElementById("table8").style.display=""
						//document.getElementById("submitbutton").style.display="";								
					}
				 } 
				}
			}
	}else if("2" == getSelectedRadiosValue("investor")){//3rd option FDI plicy
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				var othAutomaticArr = new Array("48","50","51","54","55","60","61","63","64","69","80","75","76","70","111");
				var othGovernmentArr = new Array("58","57","59","62","65","66","67","68","71","74","77","109");
				var automaticsector = document.getElementById("subsectorid");
				var autoAndGov = new Array("52","56","49","53","36","72","73","108");
				document.getElementById("table8").style.display="none";
				document.getElementById("table4").style.display="none";
				if(automaticsector != null && automaticsector != ""){
				for (var i = 0; i < othAutomaticArr.length; i++){
					if(othAutomaticArr[i] == automaticsector.value){
					 document.getElementById("submitbutton").style.display="none";
					 document.getElementById("table4").style.display="";								
					}
					  } 
				for (var i = 0; i < othGovernmentArr.length; i++){
					if(othGovernmentArr[i] == automaticsector.value){
						document.getElementById("submitbutton").style.display="";								
					}
					  } 
				for (var i = 0; i < autoAndGov.length; i++){
					if(autoAndGov[i] == automaticsector.value){
						document.getElementById("table4").style.display="";								
				}
				  }
			    }
				}
	}else if("6" == getSelectedRadiosValue("investor")){ //OCB's
			if("8" == getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("submitbutton").style.display="";
			}else if("10" != getSelectedRadiosValue("entity")){
				document.getElementById("table4").style.display="none";
				document.getElementById("table8").style.display="";
			}else if("10" == getSelectedRadiosValue("entity")){
				var othAutomaticArr = new Array("48","50","51","54","55","60","61","63","64","69","80","75","76","70","111");
				var othGovernmentArr = new Array("46","57","58","59","62","65","66","67","68","71","74","77","109");
				var automaticsector = document.getElementById("subsectorid");
				var autoAndGov=new Array("52","49","53","56","36","72","73","108");
				document.getElementById("table8").style.display="none";
				document.getElementById("table4").style.display="none";
				if(automaticsector != null && automaticsector != ""){
				for (var i = 0; i < othAutomaticArr.length; i++){
					if(othAutomaticArr[i] == automaticsector.value){
					 document.getElementById("submitbutton").style.display="none";
					 document.getElementById("table4").style.display="";								
					}
					  } 
				for (var i = 0; i < autoAndGov.length; i++){
					if(autoAndGov[i] == automaticsector.value){
						document.getElementById("table4").style.display="";								
					}
					  } 
				for (var i = 0; i < othGovernmentArr.length; i++){
					if(othGovernmentArr[i] == automaticsector.value){
						document.getElementById("submitbutton").style.display="";								
					}}
					  } 
			}
    }
}
function onClickRepatriation(){
	//document.getElementById("selected").style.display="none";
	var repyes=document.getElementById("repyes");
	 var repno=document.getElementById("repno");
	 var sectorId=document.getElementById("sectorid");
	 var subsector = document.getElementById("subsectorid");
	 onInvModeChange('quest2'); radioUncheckFun("modeofinvest"); radioUncheckFun("msmed"); radioUncheckFun("notmsmed");
	 //alert(sectorId.value);
	 if(repyes.checked){
		 if("4" == getSelectedRadiosValue("investor")){
			 document.getElementById("submitbutton").style.display="";
		 }
			 
	     if(sectorId.value >= 89){
	    	 document.getElementById("Answers").style.display="none";
	    	 document.getElementById("submitbutton").style.display="";
	    	 document.getElementById("table4").style.display="none";
	     }else{
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("table5").style.display="none";
		 document.getElementById("table7").style.display="none";
		 document.getElementById("submitbutton").style.display="none";
		 document.getElementById("table4").style.display="";
		}if(subsector.value == "111" || sectorId.value == "110"){
			document.getElementById("Answers").style.display="none";
			 document.getElementById("table5").style.display="none";
			 document.getElementById("table7").style.display="none";
			 document.getElementById("submitbutton").style.display="none";
			 document.getElementById("table4").style.display="";
		}
	     if("4" == getSelectedRadiosValue("investor")){
			 var nriGovernmentArr = new Array("97","32","35","40","39","57","58","59","62","65","66","67","68","71","74","77","109");
			 var automaticsector = document.getElementById("sectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
			 var automaticsector1 = document.getElementById("subsectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector1.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
		 }		
	     }
	 if(repno.checked){
		 if(sectorId.value >= 89){
	    	 radioUncheckFun("modeofinvest");
	    	 document.getElementById("Answers").style.display="none";
	    	 document.getElementById("table5").style.display="none";
	    	 document.getElementById("table7").style.display="none";
	    	 document.getElementById("submitbutton").style.display="";
	    	 document.getElementById("table4").style.display="none";
	     }else{
		 document.getElementById("Answers").style.display="none";
		 document.getElementById("table5").style.display="none";
    	 document.getElementById("table7").style.display="none";
    	 document.getElementById("submitbutton").style.display="";
		 document.getElementById("table4").style.display="none";
		}
		 if("4" == getSelectedRadiosValue("investor")){
			 var nriGovernmentArr = new Array("97","32","35","40","39","57","58","59","62","65","66","67","68","71","74","109");
			 var automaticsector = document.getElementById("sectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
			 var automaticsector1 = document.getElementById("subsectorid");
			 for (var i = 0; i < nriGovernmentArr.length; i++){
					if(nriGovernmentArr[i] == automaticsector1.value){
						 document.getElementById("table4").style.display="none";
						 document.getElementById("submitbutton").style.display="";								
					}
					  } 
		 }		 
	 }
}
function goForSectorConditions(){
	var sectorid=document.getElementById('sectorid');
	 wLeft = window.screenLeft ? window.screenLeft : window.screenX;
     wTop = window.screenTop ? window.screenTop : window.screenY;
	 w=600;  h=320;
    var left = wLeft + (window.innerWidth / 2) - (w / 2);
    var top = wTop + (window.innerHeight / 2) - (h / 2);
    var settings='toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left;
    if(null != sectorid)
    var URL="dropDownAction.do?sectorvalue="+sectorid.value+"&method=SectorInfo";
    window.target='sector';
	myWind=window.open(URL,'sector',settings);
	//myWind.document.write("Test Success...!"+sectorid.value);
	myWind.focus();
}
function goForGuidelines(){
	 wLeft = window.screenLeft ? window.screenLeft : window.screenX;
     wTop = window.screenTop ? window.screenTop : window.screenY;
	 w=600; h=320;
    var left = wLeft + (window.innerWidth / 2) - (w / 2);
    var top = wTop + (window.innerHeight / 2) - (h / 2);
    var settings='toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left;
    var URL="dropDownAction.do?formGuideId=FDITOOL.GuideInfo&method=FormGuidsInfo";
	window.target='target';
    myWind=window.open(URL,'target',settings);
	//myWind.document.write("Guidelines Test Success...!");
	myWind.focus();
	
}
</script>
<body bgcolor="">
	<form name="frm" method="post">
		<table width="730" align="center" border="0" cellspacing="0"
			cellpadding="0" valign="middle">
			<input type="hidden" name="formId" value="1" />
		</table>
		<table width="730" align="center" class="TBFORM" border="0"
			cellspacing="0" cellpadding="0" valign="middle">

			<tr>
				<td align="center" height="10" class="TITLEFORM">FDI Tool</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td width="730" style="padding-left:10px">
					<table width="700" align="center" class="TDBBLRFORM" border="0"
						cellspacing="0" cellpadding="0" valign="middle">
						<tr>
							<td colspan="2" class="testform" width="700" id="" callspan="0"><b>Type
									Of Investor</b> &nbsp;<a class="anchor" style="display: none;" id="quest"
								href="javascript:onChangeInvestor('quest')" value="show all"
								align="right">show all</a></td>
						</tr>
						<tr>
								<td>
									<table width="700" align="center" border="0" cellspacing="0"
										cellpadding="0" valign="middle">
						<% if(optionsList123 != null){
	for(int i=0;i<optionsList123.size();i++){
	OptionsList obj =(OptionsList)optionsList123.get(i); 
	if(obj.getListTypeId() != null && obj.getListTypeId().equals("10") && obj.getShowFlag().equals("Y")){
	%>
						<%-- <tr id="litag<%=obj.getOptionValue()%>">
							<td><font><label
										for="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"><input
											type="radio" name="investor"
											id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"
											value="<%= obj.getOptionValue()%>"
											onclick="onChangeInvestor('<%=obj.getOptionId() %>~<%=obj.getQestFlag() %>')" />&nbsp;&nbsp;&nbsp;<%= obj.getOptionLabel()%></label></font></td>
						</tr> --%>
						<tr id="litag<%=obj.getOptionValue()%>">
											<td width="30" valign="top"><input type="radio"
												name="investor" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"
												value="<%=obj.getOptionValue()%>" title="<%=obj.getOptionValue()%>" 
												onclick="onChangeInvestor('<%=obj.getOptionId() %>~<%=obj.getQestFlag() %>')" /></td>
											<td width="670" valign="top"><font><label
														for="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"><%=(!"2".equals(obj.getOptionValue())) ? obj.getOptionLabel() : ("<u title='Includes a Overseas Body Corporate (OCB). Please refer to General Guidelines at the bottom of the Conclusion for major conditions for OCB incorporated prior to 16th September 2003.'>"+obj.getOptionLabel()+"</u>")%></label></font></td>
										</tr>
						<%	
	}
	}	  		
} %>
								</table>
								</td>
							</tr>
					</table>
					<div id="table1" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>

						<table width="700" align="center" class="TDBBLRFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr>
								<td colspan="2" class="testform" width="700" align="left"><b>Type Of
										Entity In India</b> &nbsp;<a class="anchor" style="display: none;" id="quest1"
									href="javascript:onChangeEntity('quest1')" value="show all"
									align="right">show all</a></td>
							</tr>
							<tr>
								<td>
									<table width="700" align="center" border="0" cellspacing="0"
										cellpadding="0" valign="middle">
							<% if(optionsList123 != null){
	for(int i=0;i<optionsList123.size();i++){
	OptionsList obj =(OptionsList)optionsList123.get(i); 
	if(obj.getListTypeId() != null && obj.getListTypeId().equals("11") && obj.getShowFlag().equals("Y")){
	%>
							<tr id="entity<%=obj.getOptionValue()%>">
								<td width='30'><input type="radio" name="entity" id="<%=obj.getOptionId()%>" value="<%=obj.getOptionValue()%>" onclick="onChangeEntity('<%=obj.getOptionId() %>')" /></td>
								<td width='670'>&nbsp;&nbsp;&nbsp;<font><label for="<%=obj.getOptionId()%>"><%= obj.getOptionLabel()%></label></font></td>
							</tr>
							<%	
	}
	}	  		
} %>
</table></td></tr>
						</table>
					</div>
					<div id="table2" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="700" align="center" class="TDBBLRFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr id="TR01" class="testform">
								<td width="400" id=""><b>Type Of Sector</b></td>
								<td width="300" align="right"><a id="sectorialcaps" class="anchor" style="width:150px;text-align:right;padding-right:10px;" href="javascript:goForSectorConditions()"><b><u>Sector Conditions</u></b></a></td>
							</tr>
							<tr id="TR0444">
								<td colspan="2"><select
									style="width: 700px; border-radius: 5px;" name="qest2"
									onChange="onSectorChange()" id="sectorid">
								</select></td>
							</tr>
						</table>
					</div>
					<div id="table3" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="700" align="center" class="TDBBLRFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr>
								<td class="testform" width="700"><b>Type Of
											Sub Sector</b></td>
							</tr>
							<tr id="TR06">
								<td colspan="2"><select class="selectClass"
									style="width: 700px; border-radius: 5px;" name="qest3"
									onChange="onSubSectorChange()" id="subsectorid">&nbsp;
								</select></td>
							</tr>
						</table>
					</div>
					<div id="table8" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="705" align="center" class="TDBBLRFORM" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr class="testform">
								<td width="305"><b>Whether The Investee Is
										&nbsp;</b></td>
								<td width="400"><b><label for="repyes"><input
											type="radio" value="Y" name="repat" id="repyes"
											onClick="onClickRepatriation()"><u  title="Sale proceeds and dividend net of taxes is eligible to be taken back from India.">Repatriation ?</u>&nbsp;&nbsp;</label><label
										for="repno"><input type="radio" value="N" name="repat"
											id="repno" onClick="onClickRepatriation()"><u  title=" Sale proceeds and dividend net of taxes is not eligible to be taken back from India.">Non Repatriation ?</u></b></td>
							</tr>
						</table>
					</div>
					<div id="table4" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="700" align="center" class="TDBBLRFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr>
								<td colspan="2" class="testform" width="700" id=""><b>Mode Of
										Investment</b> &nbsp;<a class="anchor" style="display: none;" id="quest2"
									href="javascript:onInvModeChange('quest2')" value="show all"
									align="right">show all</a></td>
							</tr>
							<tr>
								<td>
									<table width="700" align="center" border="0" cellspacing="0"
										cellpadding="0" valign="middle">
							<% if(optionsList123 != null){
	for(int i=0;i<optionsList123.size();i++){
	OptionsList obj =(OptionsList)optionsList123.get(i); 
	if(obj.getListTypeId() != null && obj.getListTypeId().equals("23") && "Y".equals(obj.getShowFlag())){
	%>
							<tr id="invmode<%=obj.getOptionValue()%>">
								<td title="<%=obj.getOptionValue()%>" width='30'><input type="radio" name="modeofinvest" id="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>" value="<%=obj.getOptionValue()%>" onclick="onInvModeChange('<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>')" /></td>
								<td width='670'>&nbsp;&nbsp;&nbsp;<font><label for="<%=obj.getOptionId()%>~<%=obj.getQestFlag()%>"><%= obj.getOptionLabel()%></label></font></td>
							</tr>
							<%	
	}
	}	  		
} %>
</table></td></tr>
						</table>
					</div>
					<table width="700" align="center" border="0" cellspacing="0"
						cellpadding="0" valign="middle">
						<tr>
							<td id="myDiv1"></td>
						</tr>
					</table>
					<div id="table5" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="705" align="center" class="TDBBLRFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr class="testform">
								<td width="605"><b>Whether the Investee Indian Company
										is Micro, Small and Medium Enterprise in terms of Micro, Small
										and Medium Enterprises Development (MSMED) Act, 2006 .</b></td>
								<td width="100"><b><label for="tr8yes">&nbsp;&nbsp;Yes&nbsp;<input
											type="radio" value="Y" name="msmed" id="tr8yes"
											onClick="onClickMSMED()"></label>&nbsp;&nbsp;<label
										for="tr8no">No&nbsp;<input type="radio" value="N"
											name="msmed" id="tr8no" onClick="onClickMSMED()"></label></b></td>
							</tr>
						</table>
					</div>
					<div id="table6" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="700" align="center" class="TDBBLRTFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle" id="test1form">
							<tr>
								<td><font><b>If yes, Please select the type of
											industry .</b></font></td>
							</tr>
							<tr>
								<td><select style="width: 700px; border-radius: 5px;"
									name="toi" onChange="onChange3()" id="optionvalue3"><option
											vlaue="Select One" default>Select One</option>

								</select>
								<td align="right"><input type="text" name="other"
									style="border-radius: 5px;" /></td>
								</td>
							</tr>
						</table>
					</div>
					<div id="table7" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
						</table>
						<table width="705" align="center" class="TDBBLRFORM" border="0"
							cellspacing="0" cellpadding="0" valign="middle">
							<tr class="testform">
								<td width="605"><b>If not MSMED, please confirm whether
										it is an industrial undertaking having an industrial license
										under the provisions of The Industries (Development &
										Regulation) Act, 1951 for items reserved for MSE Sector .</b>
								<td width="100"><b><label for="yesnmsmed">&nbsp;&nbsp;Yes&nbsp;<input
											type="radio" value="Y" name="notmsmed" id="yesnmsmed"
											onClick="onClickNotMSMED()"></label>&nbsp;&nbsp;<label
										for="nonmsmed">No&nbsp;<input type="radio" value="N"
											name="notmsmed" id="nonmsmed" onClick="onClickNotMSMED()"></label></b></td>
								</td>
							</tr>
						</table>
					</div>
					<div id="submitbutton" style="display: none;">
						<table width="700" align="center" border="0" cellspacing="0"
							cellpadding="0" valign="middle">
							<tr>
								<td>&nbsp;</td>
							</tr>
							<tr align="center">
								<td><a class="anchor" align="center" id="finalanswer"
									href="javascript:goForConclution()" value="">Go For
										Conclusion</a></td>
							</tr>
							<!-- <tr>
								<td id="selected" style="display: none;"></td>
							</tr> -->
						</table>
					</div>
					<div id='bottom'>
						<div id="Answers" style="display: none;">
							<table width="700" align="center" border="0" cellspacing="0"
								cellpadding="0" valign="middle">
								<tr>
									<td>&nbsp;</td>
								</tr>
							</table>

							<table width="700" bgcolor="#E5E4E2" align="center"
								class="TBFORM"" border="0" cellspacing="0" cellpadding="0"
								valign="middle">
								<tr>
									<td class="testform" width="700" callspan="1" align="left"><font size="2"><b>Know Eligibility with Allied Conditions</b></font></td>
								</tr>
								<tr>
									<td id="myDiv" align="center">
										<table width="700" align="center" border="0" cellspacing="0"
											cellpadding="0" valign="middle">
										</table>
									</td>
								</tr>
							</table>
							<table width="700" align="center" border="0" cellspacing="0"
								cellpadding="0" valign="middle">
								<tr>
									<td>&nbsp;</td>
								</tr>
							</table>
							<table width="700" align="center" border="0" cellspacing="0"
								cellpadding="0" valign="middle">
								<tr>
									<td><a class="anchor" style="width:170px;" id="GGLines"
									href="javascript:goForGuidelines()" value=""><b>General
										Guidelines</b></a></td>
								</tr>
							</table>
						</div>
					</div>
			<tr>
				<td>&nbsp;</td>
			</tr>
			</td>
			</tr>
		</table>
		<table width="700" align="center" border="0" cellspacing="0"
			cellpadding="0" valign="middle">
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
		</table>

	</form>
</body>
<script type="text/javascript">
function setVisibilityArr(varArray,visibility){
    if(null != varArray){
        for(i = 0; i < varArray.length; i++){
            var tdvar = varArray[i];
            if(tdvar != null){
            tdvar.style.display=visibility;
            }
        }
    }
 }
document.body.onload = function(){
    document.getElementById("sectorid").selected='';
     radioUncheckFun("entity");	
	 radioUncheckFun("investor");
	 radioUncheckFun("modeofinvest");	
	 radioUncheckFun("msmed");
	 }
</script>
</html>